﻿<!DOCTYPE html>
<html>
<head>
	<title></title>
	<meta charset="utf-8">
	<link rel="stylesheet" type="text/css" href="http://www.1hwj.net/down/leaflet/leaflet.css">
	<style type="text/css">
		body {
			padding: 0;
			margin: 0;
		}
		html, body, #map {
			height: 100%;
		}
	</style>
	<script src="https://unpkg.com/leaflet@1.5.1/dist/leaflet.js" integrity="sha512-GffPMF3RvMeYyc1LWMHtK8EbPv0iNZ8/oTtHPx9/cc2ILxQ+u905qIwdpULaqDkyBKgOaB57QTMg7ztg8Jm2Og==" crossorigin=""></script>
	<script src='http://www.1hwj.net/down/leaflet/leaflet.ChineseTmsProviders.js'></script>
</head>
<body>
	<div id='map'></div>
</body>
</html>

<script>
	// layers
	var normalMap = L.tileLayer.chinaProvider('Google.Normal.Map', { maxZoom: 21, minZoom: 5 });
	var satelliteMap = L.tileLayer.chinaProvider('Google.Satellite.Map', { maxZoom: 18, minZoom: 5 });
	var baseLayers = { "map": normalMap, "image": satelliteMap };

	// map
	var map = L.map("map", {
		center: [39.922948, 116.39149],
		zoom: 16,
		layers: [normalMap],
		zoomControl: false
	});

	// layers
	L.control.layers(baseLayers, null).addTo(map);

	// controls
	L.control.zoom({
		zoomInTitle: '+',
		zoomOutTitle: '-'
	}).addTo(map);

	// tile
	L.TileLayer.T = L.TileLayer.extend({
		getTileUrl: function (coords) {
            return 'tiles/' + coords.z + '/' + coords.x + '_' + coords.y + '.png';
		}
	});
    map.addLayer(new L.TileLayer.T());
</script>

